package xyz.coolcsm.security.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.coolcsm.security.config.JsonResult;
import xyz.coolcsm.security.config.ResultTool;
import xyz.coolcsm.security.entity.SysUser;
import xyz.coolcsm.security.service.SysUserService;

import java.util.List;
/**
 * @author 什锦
 * @since 2021-06-1
 */

@RestController
public class HelloController {

    @Autowired
    SysUserService sysUserService;


    @RequestMapping("/hello")
    public String hello(){
        return "hello";
    }

    @GetMapping("/getUser")
    public JsonResult getUser() {
        List<SysUser> users = sysUserService.queryAllByLimit(1, 100);
        return ResultTool.success(users);
    }



}
